package com.panfeng.xcloud.common.core.candle;

import java.math.BigDecimal;

public class CandleEntry extends Entry {
    private float mShadowHigh = 0.0F;
    private float mShadowLow = 0.0F;
    private float mClose = 0.0F;
    private float mOpen = 0.0F;
    private float mVolume = 0.0F;
    private Long mOpenTime = 0l;
    private Long mCloseTime = 0l;
    private BigDecimal mQuoteAssetVolume;

    public CandleEntry(float x, float shadowH, float shadowL, float open, float close, float volume, Long openTime, Long closeTime, BigDecimal quoteAssetVolume) {
        super(x, (shadowH + shadowL) / 2.0F);
        this.mShadowHigh = shadowH;
        this.mShadowLow = shadowL;
        this.mOpen = open;
        this.mClose = close;
        this.mVolume = volume;
        this.mOpenTime = openTime;
        this.mCloseTime = closeTime;
        this.mQuoteAssetVolume = quoteAssetVolume;
    }

    public CandleEntry(float x, float shadowH, float shadowL, float open, float close, float volume, Long openTime, Long closeTime, BigDecimal quoteAssetVolume, Object data) {
        super(x, (shadowH + shadowL) / 2.0F, data);
        this.mShadowHigh = shadowH;
        this.mShadowLow = shadowL;
        this.mOpen = open;
        this.mClose = close;
        this.mVolume = volume;
        this.mOpenTime = openTime;
        this.mCloseTime = closeTime;
        this.mQuoteAssetVolume = quoteAssetVolume;
    }

    public float getShadowRange() {
        return Math.abs(this.mShadowHigh - this.mShadowLow);
    }

    public float getBodyRange() {
        return Math.abs(this.mOpen - this.mClose);
    }

    public float getY() {
        return super.getY();
    }

    public CandleEntry copy() {
        CandleEntry c = new CandleEntry(this.getX(), this.mShadowHigh, this.mShadowLow, this.mOpen, this.mClose, this.mVolume, this.mOpenTime, this.mCloseTime, this.mQuoteAssetVolume, this.getData());
        return c;
    }

    public float getHigh() {
        return this.mShadowHigh;
    }

    public void setHigh(float mShadowHigh) {
        this.mShadowHigh = mShadowHigh;
    }

    public float getLow() {
        return this.mShadowLow;
    }

    public void setLow(float mShadowLow) {
        this.mShadowLow = mShadowLow;
    }

    public float getClose() {
        return this.mClose;
    }

    public void setClose(float mClose) {
        this.mClose = mClose;
    }

    public float getOpen() {
        return this.mOpen;
    }

    public void setOpen(float mOpen) {
        this.mOpen = mOpen;
    }

    public float getVolume() {
        return this.mVolume;
    }

    public void setVolume(float mVolume) {
        this.mVolume = mVolume;
    }

    public Long getOpenTime() {
        return this.mOpenTime;
    }

    public void setOpenTime(Long mOpenTime) {
        this.mOpenTime = mOpenTime;
    }

    public Long getCloseTime() {
        return this.mCloseTime;
    }

    public void setCloseTime(Long mCloseTime) {
        this.mCloseTime = mCloseTime;
    }

    public BigDecimal getQuoteAssetVolume() {
        return this.mQuoteAssetVolume;
    }

    public void setQuoteAssetVolume(BigDecimal mQuoteAssetVolume) {
        this.mQuoteAssetVolume = mQuoteAssetVolume;
    }

}